import request from '@/utils/request'

const api_name = '/flash'

export default { 
    getFlashList() {
        return request.get(`${api_name}/list`)
    },
    getFlashDetail(id: number) {
        return request.get(`${api_name}/detail/${id}`)
    },
    getFlashProductList(params: {
        page: number
        size: number
        name: string
    }) {
        return request.get(`${api_name}/list`, { params })
    },
    // 新增秒杀接口
    startFlash(productId: number) {
        return request.post(`${api_name}/start`, { productId })
    }
}